package com.sanqi.work.service.impl;

import java.util.List;
import com.sanqi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sanqi.work.mapper.WorkWorkplaceMapper;
import com.sanqi.work.domain.WorkWorkplace;
import com.sanqi.work.service.IWorkWorkplaceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 职场Service业务层处理
 * 
 * @author duany
 * @date 2025-09-24
 */
@Service
public class WorkWorkplaceServiceImpl extends ServiceImpl<WorkWorkplaceMapper, WorkWorkplace> implements IWorkWorkplaceService 
{
    @Autowired
    private WorkWorkplaceMapper workWorkplaceMapper;

    /**
     * 查询职场
     * 
     * @param id 职场主键
     * @return 职场
     */
    @Override
    public WorkWorkplace selectWorkWorkplaceById(String id)
    {
        return workWorkplaceMapper.selectWorkWorkplaceById(id);
    }

    /**
     * 查询职场列表
     * 
     * @param workWorkplace 职场
     * @return 职场
     */
    @Override
    public List<WorkWorkplace> selectWorkWorkplaceList(WorkWorkplace workWorkplace)
    {
        return workWorkplaceMapper.selectWorkWorkplaceList(workWorkplace);
    }

    /**
     * 新增职场
     * 
     * @param workWorkplace 职场
     * @return 结果
     */
    @Override
    public int insertWorkWorkplace(WorkWorkplace workWorkplace)
    {
        boolean save = save(workWorkplace);
        return save ? 1 : 0;
    }

    /**
     * 修改职场
     * 
     * @param workWorkplace 职场
     * @return 结果
     */
    @Override
    public int updateWorkWorkplace(WorkWorkplace workWorkplace)
    {
        boolean updateById = this.updateById(workWorkplace);
        return updateById ? 1 : 0;
    }

    /**
     * 批量删除职场
     * 
     * @param ids 需要删除的职场主键
     * @return 结果
     */
    @Override
    public int deleteWorkWorkplaceByIds(String[] ids)
    {
        return workWorkplaceMapper.deleteWorkWorkplaceByIds(ids);
    }

    /**
     * 删除职场信息
     * 
     * @param id 职场主键
     * @return 结果
     */
    @Override
    public int deleteWorkWorkplaceById(String id)
    {
        return workWorkplaceMapper.deleteWorkWorkplaceById(id);
    }
}
